//
//  UIViewController+Alert.m
//  driftbottle
//
//  Created by wujian on 2017/4/7.
//  Copyright © 2017年 wujian. All rights reserved.
//

#import "UIViewController+WjAlert.h"

@implementation UIViewController (WjAlert)

- (void)alertController:(NSString *)string andTitle:(NSString *)title{
    
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:string preferredStyle:UIAlertControllerStyleAlert];
    
    UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
        
        [self alertActionStyleCancel];
        
    }];
    //    [cancleAction setValue:CSColorFromRGB(0xbebebe) forKey:@"_titleTextColor"];
    
    UIAlertAction *sureAction = [UIAlertAction actionWithTitle:title  style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
        
        [self alertActionStyleDestructive];
    }];
    //    [sureAction setValue:TabBarTextColor forKey:@"_titleTextColor"];
    
    [alert addAction:cancleAction];
    
    [alert addAction:sureAction];
    
    [self presentViewController:alert animated:YES completion:nil];
}

- (void)alertController:(NSString *)string
{
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:string preferredStyle:UIAlertControllerStyleAlert];
    
    UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
        
        [self alertActionStyleCancel];
        
    }];
//    [cancleAction setValue:CSColorFromRGB(0xbebebe) forKey:@"_titleTextColor"];
    
    UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"购买"  style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
        
        [self alertActionStyleDestructive];
    }];
//    [sureAction setValue:TabBarTextColor forKey:@"_titleTextColor"];
    
    [alert addAction:cancleAction];
    
    [alert addAction:sureAction];
    
    [self presentViewController:alert animated:YES completion:nil];
    
}
- (void)alertActionStyleCancel {
    
}
- (void)alertActionStyleDestructive {
    
}

@end
